function getDouble(n) {
    return n * 2;
}
let obj = {};
let count = 1;
let double = getDouble(count);

Object.defineProperty(obj, 'count', {
    get() {
        return count;
    },
    set(value) {
        count = value;
        double = getDouble(value);
    }
})

console.log(double);
obj.count = 2;
console.log(double);